<%@ page import="java.util.List" %>

<%@ taglib uri="/WEB-INF/bpmapp.tld" prefix="ssp" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<% String ctPath = request.getContextPath(); %>

<jsp:useBean id="bv_user_logged_in" scope="session" class="java.lang.String" />

<logic:equal name="bv_user_logged_in" value="true">

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message bundle="appCommonRes" key="bp.myContent.inbox"/>">
<tr>
  <td valign="top" width="100%">
  <div class="app_pageTitle">
    <span class="left"><bean:message bundle="appCommonRes" key="bp.myContent.inbox" /></span>
  </div>

  <div class="app_pageSubtitle">
    <span class="left"><bean:message  bundle="appCommonRes" key="bp.myContent.inbox"/></span>
  </div>

	<div class="blockWrap">
<table width="100%" class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="<bean:message bundle="appCommonRes" key="bp.myContent.inbox"/>">

<tr class="listHeader">
  <th id="Name" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.name" />
  </th>
  <th id="Version" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.version" />
  </th>
  <th id="Type" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.type" />
  </th>
  <th id="Modified On" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.modifiedOn" />
  </th>
  <th id="Modified By" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.modifiedBy" />
  </th>
  <th id="Checked Out By" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.checkedOutBy" />
  </th>
  <th id="Process Instance Name" align="left">
    <bean:message bundle="appCommonRes" key="bp.myContent.processInstance" />
  </th>
</tr>

<ssp:myContent id="contentList"/>

<logic:iterate id="contentItem" name="contentList" indexId="index">
  <tr class="<%=index.intValue() % 2 == 0? "listEven" : "listOdd" %>" >

  <td headers="Name">
  <html:link page="/ca/myContentDocInfo.do?" name="contentItem" property="urlParams">
    <bean:write name="contentItem" property="name" />
  </html:link>
  </td>

  <td headers="Version">
    <logic:equal name="contentItem" property="version" value="-1">
      <bean:message bundle="appCommonRes" key="bp.content.workingCopy"/>
    </logic:equal>
    <logic:notEqual name="contentItem" property="version" value="-1">
      <bean:write name="contentItem" property="version"/>
    </logic:notEqual>
  </td>

  <td headers="Type">
    <bean:write name="contentItem" property="type" />
  </td>
  
  <td headers="Modified On">
    <bean:write name="contentItem" property ="modifiedOn" formatKey="format.datetime.short" />
  </td>

  <td headers="Modified By">
    <bean:write name="contentItem" property ="modifiedBy" formatKey="format.datetime.short"/>
  </td>

  <td headers="Checked Out By">
    <bean:write name="contentItem" property ="checkedOutBy"/>
  </td>
  
  <td headers="Process Instance Name">
      <bean:write name="contentItem" property ="processInstanceName"/>
  </td>

  </tr>
</logic:iterate>

<%
  int numContents = ((List)pageContext.getAttribute("contentList")).size();
  if (numContents <= 0)
  {
%>
  <tr class="listOdd">
    <td colspan="7" align="center">
      <bean:message bundle="appCommonRes" key="bp.myContent.noContent" />
    </td>
  </tr>
<%
  }
%>

</table>

</logic:equal>
</div>
</td>
</tr>
</table>
